<?php $this->pageTitle = '用户管理'; ?>
<!-- h2 stays for breadcrumbs -->
<h2><a href="#">后台管理</a> &raquo; <a href="#" class="active"><?php __('用户');?></a></h2>
<div id="main">
<div class="users index">
<p>
<?php echo $paginator->counter(array('format' => '第 %page% 页，共 %pages% 页, 显示当前 %current% 记录，共有 %count% 记录, 开始于 %start%, 结束于 %end%')); ?></p>
<form action="/admin/users" method="post" >
	<fieldset>
		<p><label>用户名:</label><input type="text" name="username" class="text-long" /><input type="submit" value="查询" /></p>		
	</fieldset>
</form>
<table cellpadding="0" cellspacing="0">
<tr>
	<td><?php echo $paginator->sort('ID', 'id');?></td>
	<td><?php echo $paginator->sort('用户名', 'username');?></td>
	<td><?php //echo $paginator->sort('password');?></td>
	<td><?php echo $paginator->sort('组', 'group_id');?></td>
	<td><?php //echo $paginator->sort('created');?></td>
	<td><?php echo $paginator->sort('付费', 'paid');?></td>
	<td><?php echo $paginator->sort('修改时间', 'modified');?></td>
	<td class="actions"><?php __('操作');?></td>
</tr>
<?php
$i = 0;
foreach ($users as $user):
	$class = null;
	if ($i++ % 2 == 0) {
		$class = ' class="odd"';
	}
?>
	<tr<?php echo $class;?>>
		<td>
			<?php echo $user['User']['id']; ?>
		</td>
		<td>
			<?php echo $user['User']['username']; ?>
		</td>
		<td>
			<?php //echo $user['User']['password']; ?>
		</td>
		<td>
			<?php echo $html->link($user['Group']['name'], array('controller' => 'groups', 'action' => 'view', $user['Group']['id'])); ?>
		</td>
		<td>
			<?php //echo $user['User']['created']; ?>
		</td>
		<td>
			<?php echo $user['User']['paid']; ?>
		</td>
		<td>
			<?php echo $user['User']['modified']; ?>
		</td>
		<td class="action">
			<?php echo $html->link(__('浏览', true), array('action' => 'view', $user['User']['id']), array('class' => 'view')); ?>
			<?php echo $html->link(__('修改', true), array('action' => 'edit', $user['User']['id']), array('class' => 'edit')); ?>
			<?php echo $html->link(__('付费', true), array('action' => 'paid', $user['User']['id']), array('class' => 'view')); ?>
			<?php echo $html->link(__('删除', true), array('action' => 'delete', $user['User']['id']), array('class' => 'delete'), sprintf(__('Are you sure you want to delete # %s?', true), $user['User']['id'])); ?>
		</td>
	</tr>
<?php endforeach; ?>
</table>
</div>
<div class="paging">
<?php    
echo $paginator->prev('« 上一页 ', null, null, array('class' => ''));  
echo $paginator->numbers();  
echo $paginator->next(' 下一页 »', null, null, array('class' => ''));
?>
</div>
<div class="actions">
	<ul>
		<li>
		<?php echo $html->link(__('新建用户', true), array('action' => 'add')); ?>|
		<?php echo $html->link(__('权限管理', true), array('controller' => 'groups', 'action' => 'index')); ?>|
		<?php echo $html->link(__('新建组', true), array('controller' => 'groups', 'action' => 'add')); ?>		
		</li>
	</ul>
</div>
</div>
